// 获取任务相关的数据接口请求
import request from '@/utils/request'

/**
 * 获取主任务数据
 */
export const getmaintaskdataapi = (data) => request({
  method: 'post',
  url: '/Task/QueryMainTask',
  data
})
/**
 * 创建主任务
 */
export const createMaintaskApi = (data) => request({
  method: 'post',
  url: '/Task/CreateMainTask',
  data
})

/**
 * 删除主任务
 */
export const deleteMaintaskApi = (data) => request({
  method: 'post',
  url: `/Task/DeleteMainTask?Id=${data}`,
  data
})

/**
 * 更新子任务
 */
export const updateSubDateApi = (data) => request({
  method: 'post',
  url: `/Task/UpdateSubTask`,
  // url: `/Task/UpdateSubTask?taskId=${data.taskId}&taskStatus=${data.taskStatus}`,
  data
})

/** 获取子任务数据
 *
 */
export const getsubtaskdataapi = (data) => request({
  method: 'post',
  url: '/Task/QuerySubTask',
  data
})

/**
 * 获取历史任务数据
 */
export const gettaskbakdataapi = (data) => request({
  method: 'post',
  url: '/Task/QueryHistoryMainTask',
  data
})

/**
 * 修改优先级
 */
export const ChangeMainTaskPriorityapi = (data) => request({
  method: 'post',
  url: '/Task/ChangeMainTaskPriority',
  data
})

/**
 * 获取创建任务的设备
 */
export const GetMachinesapi = (data) => request({
  method: 'get',
  url: '/Common/GetMachines',
  data
})

/**
 * 获取创建任务的货架级联信息
 */
export const GetLocationCascaderapi = (data) => request({
  method: 'get',
  url: '/Common/GetLocationCascader',
  data
})